//函数指针数组
//void (School::*pf[2])() = {tea,stu}; 
//(this->*pf[3])();

#include<iostream>
using namespace std;

class School 
{
public:
    School()
    {
        pf[0] = stu;
        pf[1] = tea;
    }
    void dis(int n)
    {
        (this->*pf[n])(); //this 指向类成员的指针，本质上存放的是偏移量
    }
    void (School::*pf[2])() = {tea,stu};    //函数指针数组
private:
    void stu()
    {
        cout<<"stu"<<endl;
    }
    void tea()
    {
        cout<<"tea"<<endl;
    }

    int n;
};

int main()
{
    School s1;
    s1.dis(1);
    return 0;
}